snapshot: Rename gtk_snapshot_translate_2d()
authorBenjamin Otte <otte@redhat.com>
Fri, 13 Jan 2017 13:36:56 +0000 (14:36 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 13 Jan 2017 13:37:48 +0000 (14:37 +0100)
It's now called gtk_snapshot_offset().

16 files changed:
docs/reference/gtk/gtk4-sections.txt
gtk/gtkbuiltinicon.c
gtk/gtkcalendar.c
gtk/gtkcellrendererpixbuf.c
gtk/gtkcellrenderertoggle.c
gtk/gtkcssgadget.c
gtk/gtkiconhelper.c
gtk/gtkiconview.c
gtk/gtkimage.c
gtk/gtkpaned.c
gtk/gtkrenderbackground.c
gtk/gtksnapshot.c
gtk/gtksnapshot.h
gtk/gtkstylecontext.c
gtk/gtktreeview.c
gtk/gtkwidget.c

index cb93cf9b8a144bede745e491ecb408695ad68318..93b5d894c67e34fd7e6e01ac646b7e70dd74eb25 100644 (file)
@@ -4463,7 +4463,8 @@ gtk_snapshot_push_blend
 gtk_snapshot_pop
 gtk_snapshot_set_transform
 gtk_snapshot_transform
-gtk_snapshot_translate_2d
+gtk_snapshot_offset
+gtk_snapshot_get_offset
 gtk_snapshot_append_node
 gtk_snapshot_append_cairo
 gtk_snapshot_append_texture
index 7b9d27ec9b5e80e187a299a74a6089eefe8f6c6c..60003b6fccc5e08060ec91a2f9e7e60be736dae9 100644 (file)
@@ -137,12 +137,12 @@ gtk_builtin_icon_snapshot (GtkCssGadget *gadget,
 {
   GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_icon (gtk_css_gadget_get_style (gadget),
                                snapshot,
                                width, height,
                                priv->image_type);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 
   return FALSE;
 }
index 532bc36ca519c7d0d9c7d7ae344a62f4064ea5ad..5c37e6f8b0537cf91d5ca4558bdc48427037beb1 100644 (file)
@@ -2158,7 +2158,7 @@ calendar_snapshot_header (GtkCalendar *calendar,
   get_component_paddings (calendar, &padding, NULL, NULL, NULL);
   context = gtk_widget_get_style_context (widget);
 
-  gtk_snapshot_translate_2d (snapshot, padding.left, padding.top);
+  gtk_snapshot_offset (snapshot, padding.left, padding.top);
 
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
     year_left = priv->year_before;
@@ -2246,7 +2246,7 @@ calendar_snapshot_header (GtkCalendar *calendar,
   g_object_unref (layout);
 
   gtk_style_context_restore (context);
-  gtk_snapshot_translate_2d (snapshot, -padding.left, -padding.top);
+  gtk_snapshot_offset (snapshot, -padding.left, -padding.top);
 }
 
 static void
@@ -2272,9 +2272,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   get_component_paddings (calendar, &padding, NULL, &day_name_padding, NULL);
   context = gtk_widget_get_style_context (widget);
 
-  gtk_snapshot_translate_2d (snapshot,
-                             padding.left + inner_border,
-                             priv->header_h + padding.top + inner_border);
+  gtk_snapshot_offset (snapshot,
+                       padding.left + inner_border,
+                       priv->header_h + padding.top + inner_border);
 
   gtk_widget_get_allocation (widget, &allocation);
 
@@ -2337,9 +2337,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   g_object_unref (layout);
 
   gtk_style_context_restore (context);
-  gtk_snapshot_translate_2d (snapshot,
-                             - (padding.left + inner_border),
-                             - (priv->header_h + padding.top + inner_border));
+  gtk_snapshot_offset (snapshot,
+                       - (padding.left + inner_border),
+                       - (priv->header_h + padding.top + inner_border));
 }
 
 static void
@@ -2717,16 +2717,16 @@ calendar_snapshot_arrow (GtkCalendar *calendar,
   else
     image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
 
-  gtk_snapshot_translate_2d (snapshot,
-                             rect.x + (rect.width - 8) / 2,
-                             rect.y + (rect.height - 8) / 2);
+  gtk_snapshot_offset (snapshot,
+                       rect.x + (rect.width - 8) / 2,
+                       rect.y + (rect.height - 8) / 2);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
                                snapshot,
                                8, 8,
                                image_type);
-  gtk_snapshot_translate_2d (snapshot,
-                             - rect.x - (rect.width - 8) / 2,
-                             - rect.y - (rect.height - 8) / 2);
+  gtk_snapshot_offset (snapshot,
+                       - rect.x - (rect.width - 8) / 2,
+                       - rect.y - (rect.height - 8) / 2);
 
   gtk_style_context_restore (context);
 }
index 0cda2e77f0a4acb2acef25a1f144191cf2ddb2c4..675f8b3298e115f02bd6d03573e3f23fb2a92db7 100644 (file)
@@ -541,9 +541,9 @@ gtk_cell_renderer_pixbuf_snapshot (GtkCellRenderer      *cell,
   if (icon_helper == NULL)
     icon_helper = create_icon_helper (cellpixbuf, widget);
 
-  gtk_snapshot_translate_2d (snapshot, pix_rect.x, pix_rect.y);
+  gtk_snapshot_offset (snapshot, pix_rect.x, pix_rect.y);
   gtk_icon_helper_snapshot (icon_helper, snapshot);
-  gtk_snapshot_translate_2d (snapshot, - pix_rect.x, - pix_rect.y);
+  gtk_snapshot_offset (snapshot, - pix_rect.x, - pix_rect.y);
 
   g_object_unref (icon_helper);
 
index 502247436bc32ab7e67afcde3a699b2cfcba0c05..c88a8ac55a17c0fdb824a2b0fda65680e9831ec6 100644 (file)
@@ -456,9 +456,9 @@ gtk_cell_renderer_toggle_snapshot (GtkCellRenderer      *cell,
         image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
     }
 
-  gtk_snapshot_translate_2d (snapshot,
-                             cell_area->x + x_offset + xpad + padding.left + border.left,
-                             cell_area->y + y_offset + ypad + padding.top + border.top);
+  gtk_snapshot_offset (snapshot,
+                       cell_area->x + x_offset + xpad + padding.left + border.left,
+                       cell_area->y + y_offset + ypad + padding.top + border.top);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context), snapshot,
                                width - padding.left - padding.right - border.left - border.right,
                                height - padding.top - padding.bottom - border.top - border.bottom,
index f2ee45609fd9d3f80beddb19a216249579608ab9..abf83e9f2eb8eca89c9b6a2838460a0e91661cee 100644 (file)
@@ -861,7 +861,7 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
   get_box_border (style, &border);
   get_box_padding (style, &padding);
 
-  gtk_snapshot_translate_2d (snapshot, x + margin.left, y + margin.top);
+  gtk_snapshot_offset (snapshot, x + margin.left, y + margin.top);
   gtk_css_style_snapshot_background (style,
                                      snapshot,
                                      width - margin.left - margin.right,
@@ -870,7 +870,7 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
                                  snapshot,
                                  width - margin.left - margin.right,
                                  height - margin.top - margin.bottom);
-  gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
+  gtk_snapshot_offset (snapshot, - x - margin.left, - y - margin.top);
 
   contents_x = x + margin.left + border.left + padding.left;
   contents_y = y + margin.top + border.top + padding.top;
@@ -885,12 +885,12 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
 
   if (draw_focus)
     {
-      gtk_snapshot_translate_2d (snapshot, x + margin.left, y + margin.top);
+      gtk_snapshot_offset (snapshot, x + margin.left, y + margin.top);
       gtk_css_style_snapshot_outline (style,
                                       snapshot,
                                       width - margin.left - margin.right,
                                       height - margin.top - margin.bottom);
-      gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
+      gtk_snapshot_offset (snapshot, - x - margin.left, - y - margin.top);
   }
 }
 
index 15d6e42ccc2b31f54a21973872caa4a316746642..048dfac23843545ef079a336377dea37384018b2 100644 (file)
@@ -143,13 +143,13 @@ gtk_icon_helper_real_snapshot (GtkCssGadget *gadget,
   int icon_width, icon_height;
 
   _gtk_icon_helper_get_size (self, &icon_width, &icon_height);
-  gtk_snapshot_translate_2d (snapshot,
-                             x + (width - icon_width) / 2,
-                             y + (height - icon_height) / 2);
+  gtk_snapshot_offset (snapshot,
+                       x + (width - icon_width) / 2,
+                       y + (height - icon_height) / 2);
   gtk_icon_helper_snapshot (self, snapshot);
-  gtk_snapshot_translate_2d (snapshot,
-                             - (x + (width - icon_width) / 2),
-                             - (y + (height - icon_height) / 2));
+  gtk_snapshot_offset (snapshot,
+                       - (x + (width - icon_width) / 2),
+                       - (y + (height - icon_height) / 2));
 
   return FALSE;
 }
index 580208f6fedc6c7425385ed8b7d85dffdaaf5e47..b17e8bccc71ecb5e2092743d9eb269e91a318663 100644 (file)
@@ -1766,9 +1766,9 @@ gtk_icon_view_snapshot (GtkWidget   *widget,
                           ),
                           "IconView Clip");
 
-  gtk_snapshot_translate_2d (snapshot,
-                             - gtk_adjustment_get_value (icon_view->priv->hadjustment),
-                             - gtk_adjustment_get_value (icon_view->priv->vadjustment));
+  gtk_snapshot_offset (snapshot,
+                       - gtk_adjustment_get_value (icon_view->priv->hadjustment),
+                       - gtk_adjustment_get_value (icon_view->priv->vadjustment));
 
   gtk_icon_view_get_drag_dest_item (icon_view, &path, &dest_pos);
 
index 271018b91332310190c26295a6dd07f09d845d83..d788270abddc8c2f5832ff615aab5b13cfceccb4 100644 (file)
@@ -1463,9 +1463,9 @@ gtk_image_render_contents (GtkCssGadget *gadget,
     }
   else
     {
-      gtk_snapshot_translate_2d (snapshot, x, y);
+      gtk_snapshot_offset (snapshot, x, y);
       gtk_icon_helper_snapshot (priv->icon_helper, snapshot);
-      gtk_snapshot_translate_2d (snapshot, -x, -y);
+      gtk_snapshot_offset (snapshot, -x, -y);
     }
 
   return FALSE;
index 276207402bc9c550d60f837d8686147458b31d7f..13edfd4c7418cba45018e64dca5198c34dce9ea4 100644 (file)
@@ -1715,14 +1715,14 @@ gtk_paned_render_handle (GtkCssGadget *gadget,
   GtkStyleContext *context = gtk_widget_get_style_context (widget);
 
   gtk_style_context_save_to_node (context, gtk_css_gadget_get_node (priv->handle_gadget));
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
 
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
                                snapshot,
                                width, height,
                                GTK_CSS_IMAGE_BUILTIN_PANE_SEPARATOR);
 
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
   gtk_style_context_restore (context);
 
   return FALSE;
index b7a46bd7af17ce570d4a06e8e7972814e70159fb..8e87e9ebeca5efb357daa887c7e730fd74d812e2 100644 (file)
@@ -389,7 +389,7 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
 
   gtk_snapshot_push_rounded_clip (snapshot, clip, "BackgroundLayerClip<%u>", idx);
 
-  gtk_snapshot_translate_2d (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
+  gtk_snapshot_offset (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
 
   if (hrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT && vrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT)
     {
@@ -399,11 +399,11 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
       x = _gtk_css_position_value_get_x (pos, width - image_width);
       y = _gtk_css_position_value_get_y (pos, height - image_height);
 
-      gtk_snapshot_translate_2d (snapshot, x, y);
+      gtk_snapshot_offset (snapshot, x, y);
 
       gtk_css_image_snapshot (image, snapshot, image_width, image_height);
 
-      gtk_snapshot_translate_2d (snapshot, -x, -y);
+      gtk_snapshot_offset (snapshot, -x, -y);
     }
   else
     {
@@ -501,15 +501,15 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
                                 ),
                                 "BackgroundLayerRepeat<%u>", idx);
                                 
-      gtk_snapshot_translate_2d (snapshot,
-                                 position_x + 0.5 * (repeat_width - image_width),
-                                 position_y + 0.5 * (repeat_height - image_height));
+      gtk_snapshot_offset (snapshot,
+                           position_x + 0.5 * (repeat_width - image_width),
+                           position_y + 0.5 * (repeat_height - image_height));
       gtk_css_image_snapshot (image, snapshot, image_width, image_height);
 
       gtk_snapshot_pop (snapshot);
     }
 
-  gtk_snapshot_translate_2d (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
+  gtk_snapshot_offset (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
 
   gtk_snapshot_pop (snapshot);
 }
index 00d6242b9378c0fa6e756becec7e7d50c1ec6256..7b8bfddf68aa7654c8eb839b38210beba6072dc8 100644 (file)
@@ -958,7 +958,7 @@ gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
 }
 
 /**
- * gtk_snapshot_translate_2d:
+ * gtk_snapshot_offset:
  * @snapshot: a $GtkSnapshot
  * @x: horizontal translation
  * @y: vertical translation
@@ -968,9 +968,9 @@ gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
  * Since: 3.90
  */
 void
-gtk_snapshot_translate_2d (GtkSnapshot *snapshot,
-                           int          x,
-                           int          y)
+gtk_snapshot_offset (GtkSnapshot *snapshot,
+                     int          x,
+                     int          y)
 {
   snapshot->state->translate_x += x;
   snapshot->state->translate_y += y;
@@ -983,7 +983,7 @@ gtk_snapshot_translate_2d (GtkSnapshot *snapshot,
  * @y: (out) (optional): return location for y offset
  *
  * Queries the offset managed by @snapshot. This offset is the
- * accumulated sum of calls to gtk_snapshot_translate_2d().
+ * accumulated sum of calls to gtk_snapshot_offset().
  *
  * Use this offset to determine how to offset nodes that you
  * manually add to the snapshot using
@@ -1235,11 +1235,11 @@ gtk_snapshot_render_background (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_background (gtk_style_context_lookup_style (context),
                                      snapshot,
                                      width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1268,11 +1268,11 @@ gtk_snapshot_render_frame (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_border (gtk_style_context_lookup_style (context),
                                  snapshot,
                                  width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1301,11 +1301,11 @@ gtk_snapshot_render_focus (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_outline (gtk_style_context_lookup_style (context),
                                   snapshot,
                                   width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1350,7 +1350,7 @@ gtk_snapshot_render_layout (GtkSnapshot     *snapshot,
                       ink_rect.width + shadow_extents.left + shadow_extents.right,
                       ink_rect.height + shadow_extents.top + shadow_extents.bottom);
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
 
   cr = gtk_snapshot_append_cairo (snapshot, &bounds, "Text<%dchars>", pango_layout_get_character_count (layout));
 
@@ -1360,7 +1360,7 @@ gtk_snapshot_render_layout (GtkSnapshot     *snapshot,
   pango_cairo_show_layout (cr, layout);
 
   cairo_destroy (cr);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1387,12 +1387,12 @@ gtk_snapshot_render_icon (GtkSnapshot     *snapshot,
   GskTexture *texture;
 
   texture = gsk_texture_new_for_pixbuf (pixbuf);
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_icon_texture (gtk_style_context_lookup_style (context),
                                        snapshot,
                                        texture,
                                        1);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
   g_object_unref (texture);
 }
 
index 1e28dd12fed2bfc2276bbe9a29a414857a6436e3..39ebd25aa0b76932e6a1ed9d9b376a47e3d3bf6c 100644 (file)
@@ -93,7 +93,7 @@ GDK_AVAILABLE_IN_3_90
 void            gtk_snapshot_pop                        (GtkSnapshot            *snapshot);
 
 GDK_AVAILABLE_IN_3_90
-void            gtk_snapshot_translate_2d               (GtkSnapshot            *snapshot,
+void            gtk_snapshot_offset                     (GtkSnapshot            *snapshot,
                                                          int                     x,
                                                          int                     y);
 GDK_AVAILABLE_IN_3_90
index 83746631ff2a9c99410a51ada15ef5d2ed2253b2..15157bd066bece7d48e691f316c138810dbc76c9 100644 (file)
@@ -2284,25 +2284,25 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
         cursor1 = &weak_pos;
     }
 
-  gtk_snapshot_translate_2d (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
   snapshot_insertion_cursor (snapshot,
                              context,
                              PANGO_PIXELS (cursor1->height),
                              TRUE,
                              direction,
                              direction2 != PANGO_DIRECTION_NEUTRAL);
-  gtk_snapshot_translate_2d (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
 
   if (direction2 != PANGO_DIRECTION_NEUTRAL)
     {
-      gtk_snapshot_translate_2d (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
       snapshot_insertion_cursor (snapshot,
                                  context,
                                  PANGO_PIXELS (cursor2->height),
                                  FALSE,
                                  direction2,
                                  TRUE);
-      gtk_snapshot_translate_2d (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
     }
 }
 
index 10d80f4f2307e1eaff6bef6c4a49677380e3b12c..898d5baffc17637d9dea1db0e5ff81f1b5383a2e 100644 (file)
@@ -5393,13 +5393,13 @@ gtk_tree_view_snapshot (GtkWidget   *widget,
                           ),
                           "TreeViewContentClip");
 
-  gtk_snapshot_translate_2d (snapshot,
-                             - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                             gtk_tree_view_get_effective_header_height (tree_view));
+  gtk_snapshot_offset (snapshot,
+                       - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
+                       gtk_tree_view_get_effective_header_height (tree_view));
   gtk_tree_view_bin_snapshot (widget, snapshot);
-  gtk_snapshot_translate_2d (snapshot,
-                             (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                             - gtk_tree_view_get_effective_header_height (tree_view));
+  gtk_snapshot_offset (snapshot,
+                       (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
+                       - gtk_tree_view_get_effective_header_height (tree_view));
 
   /* We can't just chain up to Container::draw as it will try to send the
    * event to the headers, so we handle propagating it to our children
@@ -10052,10 +10052,10 @@ gtk_tree_view_snapshot_arrow (GtkTreeView *tree_view,
   gtk_style_context_set_state (context, state);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
 
-  gtk_snapshot_translate_2d (snapshot, area.x, area.y);
+  gtk_snapshot_offset (snapshot, area.x, area.y);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context), snapshot,
                                area.width, area.height, image_type);
-  gtk_snapshot_translate_2d (snapshot, -area.x, -area.y);
+  gtk_snapshot_offset (snapshot, -area.x, -area.y);
 
   gtk_style_context_restore (context);
 }
index 0c1b7407a94e29fd97886c0d7d955f0674103297..ff666b32c1b941d75ac64b71bb22603e9ae6f596 100644 (file)
@@ -15854,8 +15854,8 @@ gtk_widget_get_translation_to_child (GtkWidget *widget,
  * gtk_widget_snapshot_child:
  * @widget: a #GtkWidget
  * @child: a child of @widget
- * @snapshot: $GtkSnapshot as passed to the container. In particular, no
- *   calls to gtk_snapshot_translate_2d() should have been applied by the
+ * @snapshot: #GtkSnapshot as passed to the container. In particular, no
+ *   calls to gtk_snapshot_offset() should have been applied by the
  *   parent.
  *
  * When a widget receives a call to the snapshot function, it must send
@@ -15882,9 +15882,9 @@ gtk_widget_snapshot_child (GtkWidget   *widget,
 
   gtk_widget_get_translation_to_child (widget, child, &x, &y);
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_widget_snapshot (child, snapshot);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 void